package com.xiaoshuidi.cloud.module.rooms.pojo.roomel;

import lombok.Data;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;

import java.io.IOException;

/**
 * @author hans.zhang
 */
@Data
public class MyGeoEntity implements ToXContentFragment {
    private double lat;
    private double lon;

    public MyGeoEntity() {
    }

    public MyGeoEntity(double lat, double lon) {
        this.lat = lat;
        this.lon = lon;
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        return builder.latlon(lat, lon);
    }
}
